<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>xScript</title>
	<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
	<link href='http://fonts.googleapis.com/css?family=Orbitron:400,700&v2' rel='stylesheet' type='text/css'>
	<link href="style.css" rel="stylesheet" type="text/css" media="all" />
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
	<script type="text/javascript" src="system.js"></script>
	<script type="text/javascript" src="compiler.js"></script>
	<script type="text/javascript" src="javascript.js"></script>
	<script type="text/javascript" src="debug.js"></script>
	<script>
		jQuery(function($) {
			var reader = new Reader("test.xs");
			var writer = new Writer("test.js");
			var compiler = new Compiler(reader);
			compiler.compile();
			var tree = compiler.nodes;
			if (tree) {
				jQuery('#_console').append(jQuery('<div></div>').html(System.displayTree(tree)));
				System.log('\n');
				jQuery('#_console').append(jQuery('<div></div>').html(
					System.displayTree(compiler.symbols)));
				System.log('\n');
				compiler.tab = '  ';
				compiler.write(writer,tree);
				writer.close();
			}
			$('span.openbtn').click(function() {
				var p = $(this).css('display','none').parents('.tree-wrap:first');
				p.find('>div.tree-block').slideDown('fast');
				p.find('>div.tree-label>span.closebtn').css('display','inline-block');
			});
			$('span.closebtn').click(function() {
				var p = $(this).css('display','none').parents('.tree-wrap:first');
				p.find('>div.tree-block').slideUp('fast');
				p.find('>div.tree-label>span.openbtn').css('display','inline-block');
			}).click();
			System.log("<b>END</b>",false);
		});
	</script>
</head>

<body>
<did id="header">
<div id="logo"><b>x</b>Script</div>
ver 0.1.1 alpha
</div>
<pre id="_console"></pre>
	
</body>

</html>